<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
<meta name="decorator" content="moduleView" />
<script src="${staticPath}/lib/accounting/0.3.2/accounting.min.js"
	type="text/javascript"></script>
<script type="text/javascript">
	function getUrl(url, iframeId) {
		var frame = $("#" + iframeId);
		if (!frame.attr("src")) {
			frame.attr("src", url);
		}
	}
	function printme() {
		document.body.innerHTML = document.getElementById('home').innerHTML;
		window.print();
	}

	$(document).ready(
			function() {
						/* $('[data-accounting]')
								.each(
										function() {
											var $this = $(this);
											if ($this
													.attr("data-accounting-precision")
													&& "" != $this
															.attr("data-accounting-precision")) {
												$this
														.html(accounting
																.formatMoney(
																		$this
																				.attr("data-accounting"),
																		"¥ ",
																		$this
																				.attr("data-accounting-precision") * 1));
											} else {
												$this
														.html(accounting
																.formatMoney(
																		$this
																				.attr("data-accounting"),
																		"¥ "));
											}
										});
						$('[data-accounting-ratio]').each(
								function() {
									var $this = $(this);
									var number = $this
											.attr("data-accounting-precision");
									var options = {
										symbol : "%",
										decimal : ".",
										thousand : ",",
										precision : 2,
										format : "%v %s"
									};
									$this.html(accounting.formatMoney(number,
											options));
								});
						if ("${active}" == "statementError") {
							$('#statementTab a[href="#errorStatement"]').tab(
									'show');
						} */
					});
</script>
</head>
<body>
	<div class="Report_f">
		<div class="Report_f_1">
			<div class="Report_f_title_1">联营对账单</div>
			<div class="o-l-action">
				<a class="btn btn-default btn-sm btn_5 pull-right" role="button"
					href="javascript:void(0)" onclick="history.go(-1)">返回</a>
				<%-- <a class="btn btn-success btn-sm btn_5 pull-right" role="button"
					href="${contextPath}/statement/stm/prepaid/exportPrepaidAndDetail?id=${stmPrepaid.id}&billNo=${stmPrepaid.billNo}">导出</a>
				 <a class="btn btn-warning btn-sm btn_5 pull-right" role="button"
					href="${contextPath}/statement/stm/error/add?billNo=${statementMainConsortium.billNo}&statementType=ZJ00"><span
					class="glyphicon glyphicon-exclamation-sign"></span>录入异常</a> --%>
					<!--<a class="btn btn-success btn-sm pull-right" role="button"
						href="${contextPath}/statement/stm/prepaid/${stmPrepaid.id}/confirmPrepaid">确认对账</a>-->
			</div>
			<div class="tab-content Report_f_title_3">
				<div class="Report_f_title_5">
					<div class="col-sm-2 leftbar_1">
						<ul class="nav Report_f_title_6">
							<li><a href="#label_1" data-toggle="tab">详细信息</a></li>
							<li><a href="#label_2" data-toggle="tab"
								onclick="getUrl('${contextPath}/statement/stm/error/showStatementErrorList?statementType=ZJ00&billNo=${stmPrepaid.billNo}','errorStatementFrame')">结算异常</a></li>
						</ul>
					</div>
					<div class="tab-content Report_f_title_3">
						<div class="tab-pane active" id="label_1">
							<table class="table table-bordered">
								<tbody>
									<tr>
										<td class="text-left" style="width: 15%"><strong>对账单号:</strong></td>
										<td style="width: 35%">${statementMainConsortium.billNo}</td>

										<td class="text-left" style="width: 15%"><strong>公司代码:</strong></td>
										<td style="width: 35%">${statementMainConsortium.companyCode}</td>
									</tr>
									<tr>
										<td class="text-left" style="width: 15%"><strong>结算起始日期:</strong></td>
										<td style="width: 35%"><fmt:formatDate
												value="${statementMainConsortium.startTime}"
												pattern="yyyy-MM-dd" /></td>

										<td class="text-left" style="width: 15%"><strong>结算截止日期:</strong></td>
										<td style="width: 35%"><fmt:formatDate
												value="${statementMainConsortium.endTime}"
												pattern="yyyy-MM-dd" /></td>
									</tr>
									<tr>
										<td class="text-left" style="width: 15%"><strong>供应商编码:</strong></td>
										<td style="width: 35%">${statementMainConsortium.supplierNo}</td>

										<td class="text-left" style="width: 15%"><strong>供应商名称:</strong></td>
										<td style="width: 35%">${statementMainConsortium.supplierName}</td>
									</tr>
									<tr>
										<td class="text-left" style="width: 15%"><strong>税码:</strong></td>
										<td style="width: 35%">${statementMainConsortium.taxCode}</td>

										<td class="text-left" style="width: 15%"><strong>税码文本:</strong></td>
										<td style="width: 35%">${statementMainConsortium.taxCodeText}</td>
									</tr>
									<tr>
										<td class="text-left" style="width: 15%"><strong>价内扣款金额:</strong></td>
										<td style="width: 35%"><fmt:formatNumber
												value="${statementMainConsortium.inDebitAmount}"
												pattern="##.##" minFractionDigits="2"></fmt:formatNumber></td>

										<td class="text-left" style="width: 15%"><strong>费用金额:</strong></td>
										<td style="width: 35%"><fmt:formatNumber
												value="${statementMainConsortium.feeAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
									</tr>
								</tbody>
							</table>
							<div class="o-l-search-builder f_9">
								<h4>扣费明细</h4>
								<table
									class="table table-striped table-hover o-l-table table-bordered"
									id="table1">
									<thead class="t_1">
										<tr>
											<th style="width: 200px">公司代码</th>
											<th style="width: 120px">费用类型</th>
											<th style="width: 120px">费用名称</th>
											<th style="width: 120px">扣费金额</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${statementMainDetail2List}" var="statementMainDetail2">
											<tr>
												<td>${statementMainDetail2.shopCode}</td>
												<td>${statementMainDetail2.feeType}</td>												
 												<td>${statementMainDetail2.feeName}</td>
 												<td><fmt:formatNumber
												value="${statementMainDetail2.paymentAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
							<div class="o-l-search-builder f_9">
								<h4>主营成本/价内扣款明细</h4>
								<table
									class="table table-striped table-hover o-l-table table-bordered"
									id="table1">
									<thead class="t_1">
										<tr>
											<th>公司代码</th>
											<th>费用名称</th>
											<th>扣费金额</th>
											<th>税金额</th>
											<th>税码</th>
											<th>金额合计</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${statementMainDetail4List}"
											var="statementMainDetail4">
											<tr>
												<td>${statementMainDetail4.companyCode}</td>												
 												<td>${statementMainDetail4.feeName}</td>
 												<td><fmt:formatNumber
												value="${statementMainDetail4.paymentAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
												<td><fmt:formatNumber
												value="${statementMainDetail4.taxAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
												<td><fmt:formatNumber
												value="${statementMainDetail4.taxCode}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
												<td><fmt:formatNumber
												value="${statementMainDetail4.totalAmount}" pattern="##.##"
												minFractionDigits="2"></fmt:formatNumber></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
						</div>
						<div class="tab-pane" id="label_2">
							<iframe id="errorStatementFrame" name="errorStatementName"
								scrolling="no" frameborder="no" width="100%"></iframe>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>